home *** CD-ROM | disk | FTP | other *** search
/ MacPeople 2000 June 1 / MACPEOPLE-2000-06-01.ISO.7z / MACPEOPLE-2000-06-01.ISO / オンラインウエア / 進め!オンラインウエア / wannabe.68k.1.0a36.sit / wannabe.68k.1.0a36 / WannaBe 68K.rsrc / TEXT_5203_formresources.txt < prev    next >
Text File  |  2000-02-22  |  6KB  |  152 lines

  1. <html>
  2. <head>
  3. <title>Form Resources in WannaBe (Deprecated)</title>
  4. <meta name="generator" content="Frontier 4.2 Mac">
  5. </head>
  6. <body bgcolor="#FFFFFF">
  7.  
  8. <a href="x-wb2:about">About WannaBe</a> |
  9. <a href="x-wb2:help">WannaBe Help</a> |
  10. <a href="x-wb2:preferences">Preferences</a> |
  11. <a href="x-wb2:searchplugins">Search Plug-ins</a> |
  12. <a href="x-wb2:bookmarks">Bookmarks</a> |
  13.  <b>Form Resources</b>
  14.  
  15. <H1>Form Resources in WannaBe (Deprecated)</H1>
  16.  
  17. Since WannaBe does not yet support HTML forms, which are used
  18. to access search engines (among other things), WannaBe needs a way
  19. to do web searches.  WannaBe now uses Sherlock-compatible 
  20. <a href="x-wb2:searchplugins">search plug-ins</a> for this purpose.
  21. Before these were supported, WannaBe used a specially-configured
  22. 'STR#' resource to do searches.  <strong>These form resources are
  23. still supported, but won't be for long, so their use is deprecated.</strong>
  24. Nevertheless, this page 
  25. describes how to add form resources to WannaBe, by editing the 
  26. WannaBe application file's resource fork. 
  27. Each additional search/form entry requires 3 steps to be enabled:
  28.  
  29. <h2>Step 1: Modify the MENU resource</h2>
  30.  
  31. To MENU resource ID 230, add a new menu item with the name of
  32. the search/form as you would like it to appear in WannaBe's Search submenu.
  33. The name must be unique and not match any menu item already in the 
  34. submenu.<p>
  35.  
  36. <h2>Step 2: Modify the Mcmd resource</h2>
  37.  
  38. To Mcmd resource ID 230, add a new command number mapping with
  39. value "-1". If you don't own CodeWarrior or haven't installed
  40. the Mcmd template for ResEdit, you append 8 F's and increase the count 
  41. in the first 2 bytes by one.  For instance, the Hex editor for the 'Mcmd' resource
  42. id 230 *as shipped* with WannaBe 1.0a3 will show:
  43. <p>
  44. <pre>
  45. 0005 FFFF FFFF FFFF
  46. FFFF FFFF FFFF FFFF
  47. FFFF FFFF FFFF  
  48. </pre>
  49. <p>
  50. To add a single entry, change this to:
  51. <p>
  52. <pre>
  53. 0006 FFFF FFFF FFFF
  54. FFFF FFFF FFFF FFFF
  55. FFFF FFFF FFFF FFFF
  56. FFFF
  57. </pre>
  58.  
  59. □<p>
  60.  
  61. (If you *do* own Codewarrior and *have* installed the Mcmd template
  62.  into ResEdit, the above step can be performed by clicking on the asterisks 
  63. in the template window and then selecting "Insert New Field(s)" 
  64. from ResEdit's resource menu.  Since all values should be "-1", it 
  65. doesn't matter if you add it at the top or bottom, as long as the number of 
  66. entries matches the number of menu items in MENU resource ID 230.)<p>
  67.  
  68. <h2>Step 3: Add a new STR# resource</h2>
  69.  
  70. The 3rd step is the hardest and most complex.  It helps if you understand how 
  71. URLs are formed from HTML form data.  
  72.  
  73. <h3>Part 3a: Create the resource</h3>
  74.  
  75. You need to create a new 'STR#' resource.  The resource ID doesn't matter, but 
  76. WannaBe will be using 'STR#' IDs in the range 3300-3399 for its own web form 
  77. resources.  I will reserve IDs in the range 3400-3599 for your own use.  This will 
  78. aid in transferring resources to new WannaBe versions when you upgrade.   
  79. While the ID doesn't matter, the name does.  The name must match *exactly* 
  80. the string for the menu item added in step 1.  Be careful not to accidentally add 
  81. trailing spaces, etc.
  82.  
  83. <h3>Part 3b: Number of strings</h3>
  84.  
  85. The string list resource must have 12 strings.  Any more than 12 are ignored, but 
  86. if the resource has less than 12, WannaBe will not create a window from the 
  87. resource.
  88.  
  89. <h3>Part 3c: Content of the Strings</h3>
  90.  
  91. The content of each string is as follows.  String list resource ID 3300 is a template 
  92. which also explains each string briefly:<p>
  93.  
  94. <b>1st string:</b>  name of the form/search window.  This does not need to match the 
  95. name of the resource/menu item, but it will probably be similar, perhaps with 
  96. "Search" prepended.<p>
  97.  
  98. <b>2nd string:</b>  The action URL of the HTML form which the window is based on.  <p>
  99.  
  100. <b>3rd:</b>  The form method.  At this time, only "GET" is supported.  
  101. Anything else will raise a signal.<p>
  102.  
  103. <b>4th:</b>  reserved.  This string is currently ignored, like some others to follow.  
  104. To be safe, just leave the string "reserved" as its value, or blank, 
  105. as in "".  In the future, if I add features which use these fields, I 
  106. will interpret "reserved" or "" as the default value.<p>
  107.  
  108. <b>5th:</b> a string of hidden data values.  This is perhaps the most complex, but it 
  109. is really not that difficult to figure out.  As of right now, the WannaBe form 
  110. window can only interpret one text INPUT field to place in the window 
  111. along with a submission button.  Many forms require more  fields, 
  112. however.  These can be added by default, via this 5th string.  The string 
  113. should consist of the appropriate <name>=<value> pairs separated 
  114. by '&'.  For instance:   <p>
  115.  
  116. <pre>
  117. search=web&format=textonly&listings=20 
  118. </pre><p>
  119.  
  120. Such a string can be constructed by looking at the HTML for the form you 
  121. wish to use and choosing the values for the various input fields that won't 
  122. be shown.  If you do not wish any extra hidden data to be added in this way, 
  123. be sure to leave the field blank, without any spaces whatsoever.<p>
  124.  
  125. <b>6th:</b> number of input fields.  At this time, only "1" is supported.  
  126. Anything else will raise a signal.<p>
  127.  
  128. <b>7th:</b> label for the first input field.  This could be something like:  "Enter 
  129. query:"<p>
  130.  
  131. <b>8th:</b> type for the first input field.  At this time, only "text" is 
  132. supported.<p>
  133.  
  134. <b>9th:</b> name for the first input field.  This should be the value of the "name" attribute of the INPUT tag for the HTML form you wish to emulate.<p>
  135.  
  136. <b>10th:</b> initial value for the first input field.  This is the initial text you wish 
  137. to appear in the edit box.  Typically blank.<p>
  138.  
  139. <b>11th:</b> reserved<p>
  140.  
  141. <b>12th:</b> reserved<p>
  142.  
  143. Remember to be careful about not adding extra spaces, as they may screw up 
  144. the generation of a proper URL to be sent to a server.  You may also want to keep
  145. a copy of your custom 'STR#' resources in a separate resource file to make it easier 
  146. to transfer them to updated versions of WannaBe. <p>
  147.  
  148. Back to WannaBe <a href="x-wb2:help">Help</a>.<p>
  149.  
  150. </body>
  151. </html>
  152.